package com.example.homework_25_6_18.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.homework_25_6_18.mapper.StudnetMapper;
import com.example.homework_25_6_18.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudnetService {

    @Autowired
    private StudnetMapper studnetMapper;

    public Student getStudetn(String username, String password) {

        Student student = new Student();
        student.setUsername(username);
        student.setPassword(password);

        QueryWrapper<Student> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(Student::getUsername, username).eq(Student::getPassword, password);

        Student student1 = studnetMapper.selectOne(queryWrapper);
        return student1;

    }
}
